home *** CD-ROM | disk | FTP | other *** search
- #if !defined(USEDUMP)
- #include "lprlib.h"
- #include "lprdef.h"
- #include "lprfuncs.h"
- #else
- #pragma load "lprDumpFile"
- #endif
-
- unsigned char * mapptr;
-
- extern unsigned char destflag;
- extern unsigned char headflag;
- extern unsigned char fmtstate;
-
- pascal void destuser(wp, inum)
- WindowPtr wp; short inum;
- {
- short gtype;
- Handle gitem;
- Rect gbox;
- GrafPort mp;
- GrafPtr gp;
- OSErr rc;
-
- GetDItem(wp, inum, >ype, &gitem, &gbox);
- rc = newmap(&mp, &gbox);
- if (rc != 0) return;
- GetPort(&gp);
- SetPort(&mp);
- MoveTo(gbox.left, gbox.top+12);
- switch(inum) {
- case 10:
- DrawString("\pUserid:");
- break;
- case 12:
- DrawString("\pPassword:");
- break;
- default:
- break;
- }
- if (!destflag) { /* copy of vmflag */
- PenPat(&qd.gray);
- PenMode(patBic);
- PaintRect(&gbox);
- }
- SetPort(wp);
- CopyBits(&mp.portBits, &(wp->portBits), &gbox, &gbox, srcCopy, 0L);
- SetPort(gp);
- ClosePort(&mp);
- DisposPtr(mapptr);
- }
-
- pascal void headuser(wp, inum)
- WindowPtr wp; short inum;
- {
- short gtype;
- Handle gitem;
- Rect gbox;
- GrafPort mp;
- GrafPtr gp;
- OSErr rc;
-
- GetDItem(wp, inum, >ype, &gitem, &gbox);
- rc = newmap(&mp, &gbox);
- if (rc != 0) return;
- GetPort(&gp);
- SetPort(&mp);
- MoveTo(gbox.left, gbox.top+12);
- switch(inum) {
- case 6:
- DrawString("\pIdentification:");
- break;
- case 8:
- DrawString("\pJob name:");
- break;
- case 10:
- DrawString("\pClassification:");
- break;
- default:
- break;
- }
- if (!headflag) { /* copy of vmflag */
- PenPat(&qd.gray);
- PenMode(patBic);
- PaintRect(&gbox);
- }
- SetPort(wp);
- CopyBits(&mp.portBits, &(wp->portBits), &gbox, &gbox, srcCopy, 0L);
- SetPort(gp);
- ClosePort(&mp);
- DisposPtr(mapptr);
- }
-
- pascal void fmtuser(wp, inum)
- WindowPtr wp; short inum;
- {
- short gtype;
- Handle gitem;
- Rect gbox;
- GrafPort mp;
- GrafPtr gp;
- OSErr rc;
-
- GetDItem(wp, inum, >ype, &gitem, &gbox);
- rc = newmap(&mp, &gbox);
- if (rc != 0) return;
- GetPort(&gp);
- SetPort(&mp);
- MoveTo(gbox.left, gbox.top+12);
- PenPat(&qd.gray);
- PenMode(patBic);
- switch(inum) {
- case 8:
- DrawString("\pTitle:");
- if (fmtstate == 1) PaintRect(&gbox);
- break;
- case 10:
- DrawString("\pIndent:");
- if (fmtstate == 1) PaintRect(&gbox);
- break;
- case 12:
- DrawString("\pTop margin:");
- if ((fmtstate == 1) || (fmtstate == 3))
- PaintRect(&gbox);
- break;
- case 14:
- DrawString("\pWidth:");
- if (fmtstate == 1) PaintRect(&gbox);
- break;
- case 16:
- DrawString("\pPage length:");
- if ((fmtstate == 1) || (fmtstate == 3))
- PaintRect(&gbox);
- break;
- case 20:
- DrawString("\pTab spacing:");
- if ((fmtstate == 1) || (fmtstate == 3))
- PaintRect(&gbox);
- break;
- default:
- break;
- }
-
- SetPort(wp);
- CopyBits(&mp.portBits, &(wp->portBits), &gbox, &gbox, srcCopy, 0L);
- SetPort(gp);
- ClosePort(&mp);
- DisposPtr(mapptr);
- }
-
- OSErr newmap(wp, box)
- GrafPtr wp;
- Rect * box;
- {
- BitMap WriteMap;
- Size mapsize;
- GrafPtr gp;
-
- WriteMap.bounds = *box;
- WriteMap.rowBytes =
- (WriteMap.bounds.right - WriteMap.bounds.left + 7) >> 3;
- if (WriteMap.rowBytes%2) WriteMap.rowBytes++;
- mapsize = WriteMap.bounds.bottom - WriteMap.bounds.top;
- mapsize = mapsize * WriteMap.rowBytes;
- mapptr = NewPtr(mapsize);
- if (mapptr == 0L) return(4);
- WriteMap.baseAddr = mapptr;
- wp->portRect = WriteMap.bounds;
- GetPort(&gp);
- OpenPort(wp);
- SetPortBits(&WriteMap);
- EraseRgn(wp->visRgn);
- SetPort(gp);
- }
-